{include file="public/header" /}



<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>项目定制</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
    <form method="get" name="formSearch" id="formSearch">
        <div class="ds-search-form">
            <dl>
                <dt>项目定制标题：</dt>
                <dd><input class="txt" name="search_brand_name" id="search_brand_name" value="{$search_brand_name}"
                        type="text"></dd>
            </dl>
            <dl>
                <dt>项目定制分类:</dt>
                <dd>
                    <select name="project_class" title="" style="width: 160px;">
                        <option value="">{$Think.lang.ds_please_choose}...</option>
                        {foreach name="project_class" item="v" key="k"}
                        <option value="{$v.id}" {if condition="$Request.param.project_class eq $v.id"
                            }selected{/if}>{$v.name} </option> {/foreach} </select> </dd> </dl> <!-- <dl>
                <dt>状态</dt>
                <dd> <select name="types">
                        <option value="" selected>{$Think.lang.ds_please_choose}</option>
                        <option value="1" <?php if(isset($_GET['types'])&&$_GET['types']==1){?>selected <?php } ?>>上架
                        </option>
                        <option value="0" <?php if(isset($_GET['types'])&&$_GET['types']==0){?>selected <?php } ?>>下架
                        </option>
                    </select></dd>
            </dl> -->
            <div class="btn_group">
                <a href="javascript:document.formSearch.submit();" class="btn "
                    title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
                {if $search_brand_name != '' || $goods_project_class != '' }
                <a class="btn" href="{:url('Goodproject/index')}"
                    title="{$Think.lang.ds_cancel_search}"><span>取消</span></a>
                {/if}
            </div>
        </div>
        <input type="hidden" value="" name="export">
    </form>
    <table class="ds-default-table">
        <thead>
            <tr>

                <th>项目定制标题</th>
                <th>项目定制分类名称</th>
                <th>项目定制总价</th>
                <th>收藏量</th>
                <th>销量</th>
                <th>状态</th>
                <th class="align-center">创建时间</th>
                <th class="align-center">{$Think.lang.ds_handle}</th>
            </tr>
        </thead>
        <tbody>
            {foreach name="brand_list" item="type" key="k}
            <tr id="ds_row_{$type.project_id}">

                <td class="w245">{$type.project_title}</td>
                <td class="w215">{$type.name}</td>
                <td class="w215">{$type.total_price}</td>
                <td class="w215">{$type.love_num}</td>
                <td class="w215">{$type.sale_num}</td>
                <td class="w200 align-center">
                    {if $type.status == 1}
                    上架
                    {else if/}
                    下架
                    {/if}
                </td>
                <td class="w200 align-center">{$type.create_time}</td>
                <td class="w300 align-center">
                    {if $type.status == 1}
                    <a class="dsui-btn-view"
                        href="javascript:dsLayerOpen('{:url('Goodproject/detail',['project_id'=>$type.project_id])}','查看-{$type.project_title}','1000px','700px')"><i
                            class="iconfont"></i>查看详情</a>
                    {else if/}
                    <a class="dsui-btn-view"
                        href="javascript:dsLayerOpen('{:url('Goodproject/detail',['project_id'=>$type.project_id])}','查看-{$type.project_title}','1000px','700px')"><i
                            class="iconfont"></i>查看详情</a>
                    <a href="{:url('Goodproject/projec_goods',['project_id'=>$type.project_id])}"
                        class="dsui-btn-edit"><i class="iconfont"></i>商品管理</a>
                    <a href="{:url('Goodproject/projec_edit',['project_id'=>$type.project_id])}"
                        class="dsui-btn-edit"><i class="iconfont"></i>{$Think.lang.ds_edit}</a>
                    <a href="javascript:dsLayerConfirm('{:url('Goodproject/projec_del',['project_id'=>$type.project_id])}','{$Think.lang.ds_ensure_del}',{$type.project_id})"
                        class="dsui-btn-del"><i class="iconfont"></i>{$Think.lang.ds_del}</a>
                    {/if}
                    <?php  if($type['status']==1){?>
                        <a href="javascript:void(0);"
                            onclick="ds_ajaxget_confirm('{:url('Goodproject/status',['project_id'=>$type.project_id])}','确定要下架吗？');"
                            class="dsui-btn-edit"><i class="iconfont"></i>{if $type['status']==0}上架{elseif
                            $type['status']==1}下架{/if}</a>
                        <?php }else if($v['status']==0){?>
                        <a href="javascript:void(0);"
                            onclick="ds_ajaxget_confirm('{:url('Goodproject/status',['project_id'=>$type.project_id])}','确定要上架吗？');"
                            class="dsui-btn-edit"><i class="iconfont"></i>{if $type['status']==0}上架{elseif
                            $type['status']==1}下架{/if}</a>
                    <?php }?>
                </td>
                
            </tr>
            {/foreach}

        </tbody>
    </table>

</div>
<script>
    $(function () {
        $('a[dstype="batch"]').click(function () {
            if ($('.checkitem:checked').length == 0) { //没有选择
                layer.alert('<?php echo \think\Lang::get('
                    select_record_want_operate '); ?>');
                return false;
            }
            var _items = '';
            $('.checkitem:checked').each(function () {
                _items += $(this).val() + ',';
            });
            _items = _items.substr(0, (_items.length - 1));

            var data_str = '';
            eval('data_str = ' + $(this).attr('data-param'));

            if (data_str.sign == 'jingle') {
                ajax_form('ajax_jingle', '<?php echo \think\Lang::get('
                    advertising '); ?>', data_str.urls + '?commonid=' + _items + '&inajax=1', '480');
            } else if (data_str.sign == 'plate') {
                ajax_form('ajax_plate', '<?php echo \think\Lang::get('
                    set_associated_layout '); ?>', data_str.urls + '?commonid=' + _items +
                    '&inajax=1', '480');
            }
        });
    });
    //查看详情
    function goods_setting_info(ids_str) {
        _uri = HOMESITEURL + "/Goodproject/detail?project_id=" + ids_str;
        dsLayerOpen(_uri, '查看详情', '800px', '600px');
    }
    /**
     * Layer 通用ifram弹出窗口
     */
    function dsLayerOpen(url, title, width, height) {
        if (!width) width = '900px';
        if (!height) height = '500px';
        layer.open({
            type: 2,
            title: title,
            area: [width, height],
            fixed: false, //不固定
            maxmin: true,
            content: url
        });
    }
</script>